SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwtplazasaabrir
AS
SELECT        dbo.tb_AperturasDeReestructura.idAperturaReestructura AS ID, dbo.tb_AperturasDeReestructura.Reestructura, 
                         dbo.vweReestructuras.Descripcion AS ReestructuraDesc, dbo.vweOrganizaciones.Nombre AS Organizacion, 
                         dbo.vweSubOrganizaciones.Descripcion AS SubOrganizacion, dbo.tb_Funciones.Descripcion AS Funcion, dbo.vweAsignaturas.Descripcion AS Asignatura, 
                         dbo.vweTurnos.Descripcion AS Turno, dbo.tb_AperturasDeReestructura.FechaAlta, dbo.tb_AperturasDeReestructura.Horas, 
                         dbo.tb_AperturasDeReestructura.NormaCreacion, dbo.tb_AperturasDeReestructura.Baja, dbo.tb_AperturasDeReestructura.FechaBaja, 
                         dbo.tb_AperturasDeReestructura.NormaCierre, dbo.tb_Sistemas.Descripcion AS Sistema, dbo.tb_FuentesDeFinanciamiento.Descripcion AS Financiamiento, 
                         dbo.tb_PartidasPresupuestarias.Descripcion AS Presupuesto, dbo.tb_Finalidades.Descripcion AS Finalidad, dbo.tb_TiposDeFuncion.Descripcion AS TipoDeFuncion, 
                         dbo.tb_Temporalidad.Descripcion AS Temporalidad, dbo.tb_AperturasDeReestructura.Horario, dbo.tb_AperturasDeReestructura.EsJefeDeOrg, 
                         dbo.tb_AperturasDeReestructura.Observaciones, dbo.tb_EstadosDeReestructura.Descripcion AS Estado
FROM            dbo.tb_AperturasDeReestructura INNER JOIN
                         dbo.tb_RegimenLaboral ON dbo.tb_AperturasDeReestructura.RegimenLaboral = dbo.tb_RegimenLaboral.idRegimenLaboral INNER JOIN
                         dbo.tb_RegimenSalarial ON dbo.tb_AperturasDeReestructura.RegimenSalarial = dbo.tb_RegimenSalarial.idRegimenSalarial INNER JOIN
                         dbo.tb_RegimenDeSuplencias ON dbo.tb_AperturasDeReestructura.RegimenSuplencias = dbo.tb_RegimenDeSuplencias.idRegimenSuplencia INNER JOIN
                         dbo.vweReestructuras ON dbo.tb_AperturasDeReestructura.Reestructura = dbo.vweReestructuras.id INNER JOIN
                         dbo.vweOrganizaciones ON dbo.tb_AperturasDeReestructura.Organizacion = dbo.vweOrganizaciones.ID INNER JOIN
                         dbo.vweSubOrganizaciones ON dbo.tb_AperturasDeReestructura.Suborganizacion = dbo.vweSubOrganizaciones.ID INNER JOIN
                         dbo.vweAsignaturas ON dbo.tb_AperturasDeReestructura.Asignatura = dbo.vweAsignaturas.ID INNER JOIN
                         dbo.vweDivisiones ON dbo.tb_AperturasDeReestructura.Division = dbo.vweDivisiones.ID INNER JOIN
                         dbo.vweTurnos ON dbo.tb_AperturasDeReestructura.Turno = dbo.vweTurnos.ID INNER JOIN
                         dbo.tb_CargosSalariales ON dbo.tb_AperturasDeReestructura.CargoSalarialDefault = dbo.tb_CargosSalariales.idCargo AND 
                         dbo.tb_RegimenSalarial.idRegimenSalarial = dbo.tb_CargosSalariales.Regimensalarial INNER JOIN
                         dbo.tb_Funciones ON dbo.tb_AperturasDeReestructura.Funcion = dbo.tb_Funciones.idFuncion INNER JOIN
                         dbo.tb_Sistemas ON dbo.tb_AperturasDeReestructura.Sistema = dbo.tb_Sistemas.idSistema INNER JOIN
                         dbo.tb_FuentesDeFinanciamiento ON dbo.tb_Funciones.Financiamiento = dbo.tb_FuentesDeFinanciamiento.idFuenteFinanciamiento AND 
                         dbo.tb_Funciones.Financiamiento = dbo.tb_FuentesDeFinanciamiento.idFuenteFinanciamiento INNER JOIN
                         dbo.tb_PartidasPresupuestarias ON dbo.tb_Funciones.Presupuesto = dbo.tb_PartidasPresupuestarias.idPartida AND 
                         dbo.tb_Funciones.Presupuesto = dbo.tb_PartidasPresupuestarias.idPartida INNER JOIN
                         dbo.tb_Finalidades ON dbo.tb_Funciones.Finalidad = dbo.tb_Finalidades.idFinalidad AND dbo.tb_Funciones.Finalidad = dbo.tb_Finalidades.idFinalidad INNER JOIN
                         dbo.tb_TiposDeFuncion ON dbo.tb_Funciones.TipoDeFuncion = dbo.tb_TiposDeFuncion.idTipoFuncion AND 
                         dbo.tb_Funciones.TipoDeFuncion = dbo.tb_TiposDeFuncion.idTipoFuncion INNER JOIN
                         dbo.tb_Temporalidad ON dbo.tb_Funciones.Temporalidad = dbo.tb_Temporalidad.idTemporalidad AND 
                         dbo.tb_Funciones.Temporalidad = dbo.tb_Temporalidad.idTemporalidad INNER JOIN
                         dbo.tb_EstadosDeReestructura ON dbo.tb_AperturasDeReestructura.Estado = dbo.tb_EstadosDeReestructura.idEstadoReestructura
GO
GRANT SELECT ON  [dbo].[vwtplazasaabrir] TO [Reestructura]
GRANT SELECT ON  [dbo].[vwtplazasaabrir] TO [SoloVer]
GO
EXEC sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tb_AperturasDeReestructura"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 135
               Right = 249
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_RegimenLaboral"
            Begin Extent = 
               Top = 6
               Left = 287
               Bottom = 101
               Right = 496
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_RegimenSalarial"
            Begin Extent = 
               Top = 6
               Left = 534
               Bottom = 101
               Right = 743
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_RegimenDeSuplencias"
            Begin Extent = 
               Top = 102
               Left = 287
               Bottom = 197
               Right = 496
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vweReestructuras"
            Begin Extent = 
               Top = 102
               Left = 534
               Bottom = 231
               Right = 743
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vweOrganizaciones"
            Begin Extent = 
               Top = 138
               Left = 38
               Bottom = 267
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vweSubOrganizaciones"
            Begin Extent = 
               Top = 198
               Left = 285
               Bott', 'USER', N'dbo', 'VIEW', N'vwtplazasaabrir', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_DiagramPane2', N'om = 327
               Right = 494
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vweAsignaturas"
            Begin Extent = 
               Top = 234
               Left = 532
               Bottom = 363
               Right = 741
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vweDivisiones"
            Begin Extent = 
               Top = 270
               Left = 38
               Bottom = 399
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vweTurnos"
            Begin Extent = 
               Top = 330
               Left = 285
               Bottom = 442
               Right = 494
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_CargosSalariales"
            Begin Extent = 
               Top = 366
               Left = 532
               Bottom = 495
               Right = 741
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Funciones"
            Begin Extent = 
               Top = 402
               Left = 38
               Bottom = 531
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Sistemas"
            Begin Extent = 
               Top = 444
               Left = 285
               Bottom = 539
               Right = 494
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_FuentesDeFinanciamiento"
            Begin Extent = 
               Top = 498
               Left = 532
               Bottom = 593
               Right = 749
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_PartidasPresupuestarias"
            Begin Extent = 
               Top = 534
               Left = 38
               Bottom = 646
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Finalidades"
            Begin Extent = 
               Top = 540
               Left = 285
               Bottom = 635
               Right = 494
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_TiposDeFuncion"
            Begin Extent = 
               Top = 594
               Left = 532
               Bottom = 706
               Right = 741
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Temporalidad"
            Begin Extent = 
               Top = 636
               Left = 285
               Bottom = 731
               Right = 494
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_EstadosDeReestructura"
            Begin Extent = 
               Top = 648
               Left = 38
               Bottom = 743
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
   ', 'USER', N'dbo', 'VIEW', N'vwtplazasaabrir', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_DiagramPane3', N'      SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
', 'USER', N'dbo', 'VIEW', N'vwtplazasaabrir', NULL, NULL
GO
DECLARE @xp int
SELECT @xp=3
EXEC sp_addextendedproperty N'MS_DiagramPaneCount', @xp, 'USER', N'dbo', 'VIEW', N'vwtplazasaabrir', NULL, NULL
GO
